This code shows how to create a Pict file by "recording" the results of a draw operation into a Pict object. Once the user selects an image file file it opens and displays the image in a new window. Clicking on the button at the top of the window saves the image as a pict file called results.pict in the application startup directory.
Every time the QDGraphics that is the recording source is drawn to this must be set to be the current GWorld or else the resultant PICT is corrupted.
A QTSession.open will perform a gestalt check to ensure that QuickTime is present and is initialized. This is a required call before any QuickTime Java classes can be used.
When the user closes the window the program will quit, first calling QTSession.close to terminate QuickTime. It is necessary for programs to call QTSession.close if they have previously called QTSession.open in order to shut down QuickTime properly.